Towards a Theory of Type Structure